<%@ page import="java.sql.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    if (session.getAttribute("LoginedManagementName") == null){
        request.getRequestDispatcher("loginForm.jsp").forward(request,response);
        return;
    }
%>
<h1>查询特殊档案信息</h1><br/>
<a href="index1.jsp">返回</a>
<hr>
<table border="1" width="100%" >
    <center>
    <tr>
        <th width="40">序号</th>
        <th width="40">学号</th>
        <th width="40">姓名</th>
        <th width="40">年级</th>
        <th width="40">班级</th>
        <th width="60">学籍状态</th>
        <th width="80">修改学籍状态时间</th>
    </tr>
    <%
        Class.forName("com.mysql.cj.jdbc.Driver");
        Connection con=DriverManager.getConnection(
                "jdbc:mysql://127.0.0.1:3307/file?useSSL=FALSE&serverTimezone=UTC"
                , "root", "123456");
        Statement st=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                ResultSet.CONCUR_READ_ONLY);
        ResultSet rs=st.executeQuery("select A.user_id,user_name,grade,banji,Enrollment_Status," +
                "Change_ES_Time from student A,dangan B where Enrollment_Status !=\"在读\"and A.user_id=B.user_id;");
        int count=1;
        while(rs.next()){
            out.print("<tr>");
            out.print("<td>"+(count++)+"</td>");
            out.print("<td>"+rs.getString("user_id")+"</td>");
            out.print("<td>"+rs.getString("user_name")+"</td>");
            out.print("<td>"+rs.getInt("grade")+"</td>");
            out.print("<td>"+rs.getInt("banji")+"</td>");
            out.print("<td>"+rs.getString("Enrollment_Status")+"</td>");
            out.print("<td>"+rs.getString("Change_ES_Time")+"</td>");
            out.print("</tr>");
        }
    %>
    </center>
</table>
<%@include file="footer.jsp" %>
</body>
</html>


